﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PJ.DBModel.Models;

namespace PJ.DBModel.Mappings
{
    public class DonationMap : IEntityTypeConfiguration<Donation>
    {
        public void Configure(EntityTypeBuilder<Donation> builder)
        {
            builder.ToTable("donation");

            builder.HasComment("捐赠表");

            builder.Property(e => e.Id).HasComment("主键");

            builder.Property(e => e.CreateTime).HasComment("创建时间");

            builder.Property(e => e.Detail)
                .HasMaxLength(100)
                .HasComment("备注");

            builder.Property(e => e.Name)
                .HasMaxLength(50)
                .HasComment("捐赠人");

            builder.Property(e => e.Price)
                .HasMaxLength(50)
                .HasComment("捐赠金额");

            builder.Property(e => e.Source)
                .HasMaxLength(50)
                .HasComment("捐赠方式");
        }
    }
}
